/*
 * SDLResource.h
 *
 *  Created on: Nov 21, 2010
 *      Author: timmeh
 */

#ifndef SDLRESOURCE_H_
#define SDLRESOURCE_H_

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include "Vector2.h"
#include <SDL/SDL_ttf.h>

namespace bo_sdl{

/**
 * SDL "Wrapper". Singleton class. Represents the actual screen
 */
class SDLResource {
public:
	static SDLResource* Instance();
	SDLResource();
	virtual ~SDLResource();
	bool Initialize(int xScreen, int yScreen, double scale);
	void BlitToScreen(SDL_Surface*, Vector2);
	void FlipScreen();
	void ClearBackBuffer();
	void Display();
	double GetScale();
	void SetBackground(const char* fileName);
	void BlitBackground();
	void DrawHUDRect();
	void DrawText(const char* string);
private:
	SDL_Surface* fScreen;
	static SDLResource* fInstance;
	double fScale;
	SDL_Surface* fBackground;
	bool fBGBlitted;
	TTF_Font* fFont;

};

}

#endif /* SDLRESOURCE_H_ */
